import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component:()=>import('../views/Home/Home.vue')
  },
  {
    path: '/home',
    name: 'Home',
    meta: {
      title:""
    },
    component: () => import('../views/Home/Home.vue'),
    children: [
      // 首页
      {
        path: '/layout',
        name: 'layout',
        component:()=>import('../views/Home/layout/Layout.vue')
      },
      // 商品列表
      {
        path: '/shop',
        name: 'shop',
        meta:{
          title:"商品/商品列表"
        },
        component: () => import('../views/Shop/Shop/Shop.vue')
      },
      // 添加商品
      {
        path: '/shopPush',
        name: 'shop',
        meta: {
          title:'添加商品'
        },
        component:()=>import('../views/Shop/ShopPush/ShopPush.vue')
      },
      // 商品分类
      {
        path: '/shopClass',
        name: 'shopClass',
        meta: {
          title: '商品分类'
        },
        component: () => import('../views/Shop/shopClass/shopClass.vue')
      },
      // 商品类型
      {
        path: '/shopType',
        name: 'shopType',
        meta: {
          title:'商品类型'
        },
        component:()=>import('../views/Shop/shopType/shopType.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component:()=>import('../views/Login/Login.vue')
  },

]

const router = new VueRouter({
  routes
})

export default router
